package com.fr.report.web.ui.impl.write;

import com.fr.base.ArrayUtils;
import com.fr.base.Inter;
import com.fr.report.js.JavaScriptImpl;
import com.fr.report.web.event.Listener;
import com.fr.report.web.ui.Icon;
import com.fr.report.web.ui.IconManager;
import com.fr.report.web.ui.ToolBarButton;
import com.fr.report.web.ui.WebContentUtils;
import com.fr.web.Repository;

public class AppendColumn extends ToolBarButton
{
  public AppendColumn()
  {
    super(Inter.getLocText("Utils-Insert_Column"), IconManager.APPENDCOLUMN.getName());
  }

  public Listener[] createListeners(Repository paramRepository)
  {
    return ((Listener[])ArrayUtils.addAll(super.createListeners(paramRepository), new Listener[] { new Listener(WebContentUtils.getContentPanel(paramRepository), "cellselect", new JavaScriptImpl("($(arguments[0]).attr('ap') == 'column') ? this.enable() : this.disable();")) }));
  }

  protected String clickAction(Repository paramRepository)
  {
    return WebContentUtils.getContentPanel(paramRepository) + ".appendReportColumn()";
  }
}